var http = require('http');

//http.createServer(function(req,res){
//    res.writeHead(200,{
//        'Content-Type':'text/plain'
//    });
//    res.end('hello world');
//}).listen(3000,'127.0.0.1');
//console.log('server listern at 3000');

http.createServer(function(req,res){
    res.writeHead(301,{
        'Location':'http://www.baidu.com'
    });
    res.end('hello world');
}).listen(3000,'127.0.0.1');
console.log('server listern at 3000');